//
//  SearchConditionCell.m
//  BusinessMarket
//
//  Created by Michael Li on 2018/11/26.
//  Copyright © 2018年 Michael Li. All rights reserved.
//

#import "SearchConditionCell.h"
@interface SearchConditionCell()
@property (weak, nonatomic) IBOutlet UIButton *timeBtn;
@property (weak, nonatomic) IBOutlet UIButton *evaluateBtn;
@property (weak, nonatomic) IBOutlet UILabel *colorL;

@end
static NSString *identifier = @"SearchConditionCell";
@implementation SearchConditionCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self.timeBtn setTitleColor:kOrangeBg forState:UIControlStateNormal];
    [self.evaluateBtn setTitleColor:kLabel153Color forState:UIControlStateNormal];
    self.colorL.backgroundColor = kLineColor;
}
+(instancetype)cellNibWithTableView:(UITableView *)tableView
{
    SearchConditionCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (!cell) {
        [tableView registerNib:[UINib nibWithNibName:@"SearchConditionCell" bundle:nil] forCellReuseIdentifier:identifier];
        cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
- (IBAction)timeBtn:(UIButton *)sender {
    [self.timeBtn setTitleColor:kOrangeBg forState:UIControlStateNormal];
    [self.evaluateBtn setTitleColor:kLabel153Color forState:UIControlStateNormal];
    if ([self.delegate respondsToSelector:@selector(searchConditionCell:withTag:)]) {
        [self.delegate searchConditionCell:self withTag:sender.tag];
    }
}
- (IBAction)evaluateBtn:(UIButton *)sender {
    [self.timeBtn setTitleColor:kLabel153Color forState:UIControlStateNormal];
    [self.evaluateBtn setTitleColor:kOrangeBg forState:UIControlStateNormal];
    if ([self.delegate respondsToSelector:@selector(searchConditionCell:withTag:)]) {
        [self.delegate searchConditionCell:self withTag:sender.tag];
    }
}


@end
